import time
from day06.tool.HTMLTestRunner import HTMLTestRunner
import unittest

# 创建测试套件
suite = unittest.defaultTestLoader.discover(start_dir='./', pattern='tpshop*.py')
# 打开文件流
file_url = './test_report/report-{}.html'.format(time.strftime('%H%m%d-%H%M%S'))
with open(file_url, 'wb') as f:
    HTMLTestRunner(stream=f, title='TPShop测试报告').run(suite)
